package models;

import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Transient;

import play.data.validation.Email;
import play.data.validation.Equals;
import play.data.validation.MaxSize;
import play.data.validation.MinSize;
import play.data.validation.Password;
import play.data.validation.Required;
import play.data.validation.Unique;
import play.db.jpa.Model;

@Entity
public class Usuario extends Model{

	@Required(message="validacao.requerido")
	public String nome;
	
	@Required(message="validacao.requerido")	
    @Unique(message="validacao.unico.login")
    @Email
	public String email;
	@Required(message="validacao.requerido")
	@MinSize(6)
	@MaxSize(16)
	@Password
	public String senha;
	
	/**
	 *  Annotation {@link Transient} usada para indicar que o campo nao sera gravado no banco de dados
	 */
	@Transient
	@Equals(value="senha",message="validacao.confirmasenha")
	@Required(message="validacao.requerido")
	@Password
    public String confirmaSenha;
}
